package com.javasm.crm.service.b2cReturns.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.javasm.crm.domin.entity.b2cReturns.B2creturnsapplygood;
import com.javasm.crm.mapper.b2cReturns.B2crreturnsapplygoodMapper;
import com.javasm.crm.service.b2cReturns.B2cReturnsApplyGoodService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author wxl
 * @since 2021-07-12
 */
@Service
@Transactional
@RequiredArgsConstructor
public class B2cReturnsApplyGoodServiceImpl extends ServiceImpl<B2crreturnsapplygoodMapper, B2creturnsapplygood> implements B2cReturnsApplyGoodService {

    private final B2crreturnsapplygoodMapper b2crreturnsapplygoodMapper;

    @Override
    public int deleteByApplyId(String applyId) {
        QueryWrapper<B2creturnsapplygood> applyQueryWrapper = new QueryWrapper<B2creturnsapplygood>();
        LambdaQueryWrapper<B2creturnsapplygood> lambda = applyQueryWrapper.lambda();
        lambda.eq(B2creturnsapplygood::getApplyId,applyId);

        int delete = b2crreturnsapplygoodMapper.delete(applyQueryWrapper);

        return delete;
    }
}
